﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RaytracerLib.MathLib;
using System.Drawing;
using YAXLib;
using TomanuExtensions;

namespace RaytracerLib.Samplers
{
    public class HammersleyFoldedSampler : HammersleySampler
    {
        protected override Vector2 NextSample()
        {
            int n = m_n;
            m_n++;

            return new Vector2(
                (n - 0.5) / m_count,
                LowDiscrepancyMath.FoldedRadicalInverse(n, BaseY));
        }

        public override SamplerType SamplerType
        {
            get 
            {
                return SamplerType.HammersleyFolded;
            }
        }
    }
}
